<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>菜单管理</title>
	<link rel="stylesheet" type="text/css" media="screen" href="${demoPath}static/plugs/validform/css/style.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="${demoPath}static/plugs/validform/css/demo.css" />
<style>

.buttons button{
　 border:0px;
　 background:transparent;
}

.buttons button.positive:hover{
text-decoration:underline;
　 color:#529214;
}
</style>
</head>
<body>
	<div class="main">
		<div class="wraper">

			<form class="registerform" action="demo/ajax_post.php">
				<table width="100%" style="table-layout: fixed;">
					<tr>
						<td class="need" style="width: 10px;">*</td>
						<td style="width: 70px;">昵称：</td>
						<td style="width: 205px;"><input type="text" value=""
							name="name" id="name" class="inputxt"/>
						</td>
					</tr>
					<tr>
						<td class="need">*</td>
						<td>密码：</td>
						<td><input type="password" value="" name="userpassword"
							class="inputxt" nullmsg="请设置密码！" errormsg="密码范围在6~16位之间！" /></td>
					</tr>
					<tr>
						<td class="need">*</td>
						<td>确认密码：</td>
						<td><input type="password" value="" name="userpassword2"
							class="inputxt" recheck="userpassword" nullmsg="请再输入一次密码！"
							errormsg="您两次输入的账号密码不一致！" /></td>
					</tr>
					<tr>
						<td class="need"></td>
						<td colspan="2" style="padding: 10px 0 18px 0;">
							<a href="javascript:void(0)" id="sData">提交测试</a>
							
							<input type="submit" value="提 交" /> <input
							type="reset" value="重 置" /></td>
					</tr>
				</table>
			</form>

		</div>
	</div>

	<script type="text/javascript" src="${demoPath}static/plugs/validform/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${demoPath}static/plugs/validform/js/Validform_v5.3.1.js"></script>
	
	<script type="text/javascript">
	    	$(function(){
	    		
	    		$("#sData").click(function(){
					$(".registerform").submit();
				});
	    		
				var demo=$(".registerform").Validform({
					tiptype:3,
					label:".label",
					showAllError:true,
					datatype:{
						"zh1-6":/^[\u4E00-\u9FA5\uf900-\ufa2d]{1,6}$/
					},
					ajaxPost:true
				});
				
				//通过$.Tipmsg扩展默认提示信息;
				$.Tipmsg.w["zh1-6"]="请输入1到6个中文字符！";
				demo.tipmsg.w["zh1-6"]="请输入1到6个中文字符！";
				
				demo.addRule([{
					ele:"input[name='name']:eq(0)",
					datatype:"zh2-4"
				},
				{
					ele:".inputxt:eq(1)",
					datatype:"*6-20"
				},
				{
					ele:".inputxt:eq(2)",
					datatype:"*6-20",
					recheck:"userpassword"
				}]);
				
			})

	    </script>

</body>
</html>
